home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / awe2-0_1.lha / awe2-0.1 / Src / SampleStatistic.h < prev    next >
C/C++ Source or Header  |  1989-10-19  |  2KB  |  75 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Dirk Grunwald (grunwald@cs.uiuc.edu)
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY.  No author or distributor
  10. accepts responsibility to anyone for the consequences of using it
  11. or for whether it serves any particular purpose or works at all,
  12. unless he says so in writing.  Refer to the GNU CC General Public
  13. License for full details.
  14.  
  15. Everyone is granted permission to copy, modify and redistribute
  16. GNU CC, but only under the conditions described in the
  17. GNU CC General Public License.   A copy of this license is
  18. supposed to have been given to you along with GNU CC so you
  19. can know your rights and responsibilities.  It should be in a
  20. file named COPYING.  Among other things, the copyright notice
  21. and this notice must be preserved on all copies.  
  22. */
  23. #ifndef SampleStatistic_h
  24. #define SampleStatistic_h 1
  25. #pragma once
  26.  
  27. class SampleStatistic {
  28.  
  29. protected:
  30.     int    n;
  31.     double x;
  32.     double x2;
  33.     double minValue, maxValue;
  34.  
  35.     double tval(double, int);
  36.  
  37. public :
  38.  
  39.     SampleStatistic();
  40.     virtual void reset(); 
  41.  
  42.     virtual void operator+=(double);
  43.     virtual int samples();
  44.     virtual double mean();
  45.     virtual double stdDev();
  46.     virtual double var();
  47.     virtual double min();
  48.     virtual double max();
  49.     virtual double sum();
  50.     virtual double confidence(int p_percentage);
  51.     virtual double confidence(double p_value);
  52.  
  53.     void            error(char* msg);
  54. };
  55.  
  56. static inline
  57. SampleStatistic::SampleStatistic()
  58. {
  59.     reset();
  60. }
  61.  
  62. #if 0
  63.  
  64. #include <stddef.h>
  65. // error handlers
  66.  
  67. //extern  void default_SampleStatistic_error_handler(char*);
  68. //extern  one_arg_error_handler_t SampleStatistic_error_handler;
  69.  
  70. //extern  one_arg_error_handler_t 
  71. //        set_SampleStatistic_error_handler(one_arg_error_handler_t f);
  72. #endif
  73.  
  74. #endif
  75.